package com.woniuxy.tfss.entity;

import lombok.Data;

@Data
public class ResponseEntity<T> {
    private int code;//200成功，500失败
    private String msg;
    private T data;

    public ResponseEntity() {

    }

    public ResponseEntity(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public ResponseEntity(int code, String msg,T data) {
        this.code = code;
        this.msg = msg;
        this.data=data;
    }

    public ResponseEntity(T data) {
        this(200, "OK");
        this.data = data;
    }

    public static final ResponseEntity<Void> SUCCESS = new ResponseEntity<>(200, "成功");
    public static final ResponseEntity<Void> FAIL = new ResponseEntity<>(500, "失败");
    public static final ResponseEntity<Void> FORBIDDEN = new ResponseEntity<>(403, "无权限");
    public static final ResponseEntity<Void> UNKNOWNACC = new ResponseEntity<>(700, "账号不存在");
    public static final ResponseEntity<Void> LOCKEDACC = new ResponseEntity<>(701, "账号被冻结");
    public static final ResponseEntity<Void> WRONGPWD = new ResponseEntity<>(702, "密码错误");
    public static final ResponseEntity<Void> UNLOGIN = new ResponseEntity<>(703, "未登录");
    public static final ResponseEntity<Void> OVERTIME = new ResponseEntity<>(704, "TOKEN过期登录失败");
    public static final ResponseEntity<Void> EXISTACC = new ResponseEntity<>(705, "账号已存在");
    public static final ResponseEntity<Void> EXISTROLE = new ResponseEntity<>(706, "角色已存在");
    public static final ResponseEntity<Void> NOACTIVERIDER = new ResponseEntity<>(801, "无活跃骑手");
    public static final ResponseEntity<Void> ARRANGESUCCESS = new ResponseEntity<>(802, "已成功预约");
    public static final ResponseEntity<Void> NOMONEY = new ResponseEntity<>(803, "余额不足");
    public static final ResponseEntity<Void> PAYFAILED = new ResponseEntity<>(804, "支付失败");
    public static final ResponseEntity<Void> WRONGSTATUS = new ResponseEntity<>(805, "状态错误");
    public static final ResponseEntity<Void> PAYHTML = new ResponseEntity<>(806, "支付页面");
    public static final ResponseEntity<Void> ROBED = new ResponseEntity<>(807, "已被抢单");
    public static final ResponseEntity<Void> WORKED = new ResponseEntity<>(808, "还有订单未完成");
}
